<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model as BaseModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class PayBillIdsModel extends BaseModel
{
    use HasFactory, SoftDeletes;

    protected $table = 't_pay_bill_ids';

    protected $primaryKey = 'id';

    public $timestamps = true;

    const CREATED_AT = 'created_at';
    
    const UPDATED_AT = 'updated_at';

    protected $guarded = [];

    protected $hidden = [
        'deleted_at',
    ];

    //客户
    // public function customer(): BelongsTo {
    //     return $this->belongsTo(CustomerModel::class, 'customer_id');
    // }

    //提单id
    public function take_order(): BelongsTo {
        return $this->belongsTo(TakeOrderModel::class, 'take_order_id');
    }

    //账单
    public function pay_bill(): BelongsTo {
        return $this->belongsTo(PayBillModel::class, 'pay_bill_id');
    }

}
